#include "BeanieCore.h"

BeanieCore::BeanieCore()
	: m_exit(false), m_exitMessage(EXIT_SUCCESS)
{

}

BeanieCore::~BeanieCore()
{

}

void BeanieCore::init(
	char* a_windowName,
	int a_windowColor,
	int a_windoWidth,
	int a_windowHeight,
	bool a_windowed,
	Handle* a_windowHandle)
{
	m_window.init(
		a_windowName,
		a_windowColor,
		a_windoWidth,
		a_windowHeight,
		a_windowed,
		a_windowHandle);
	m_graphics.init(&m_window);
	m_input.init(&m_window);

	m_fps.init();
	m_time.init();
}

void BeanieCore::release()
{
	m_graphics.release();
}

void BeanieCore::update()
{
	if(!m_window.hMsg()) m_exit = true;
	if(m_exit) return;

	m_fps.update();
	m_time.update();
}